(function(n,t){typeof define=="function"&&define.amd?define(function(){return t(n)}):typeof exports=="object"?module.exports=t:n.echo=t(n)})(this,function(n){"use strict";var t={},f=function(){},r,u,o,s,e,h=function(n){return n.offsetParent===null},c=function(n,t){if(h(n))return!1;var i=n.getBoundingClientRect();return i.right>=t.l&&i.bottom>=t.t&&i.left<=t.r&&i.top<=t.b},i=function(){(s||!u)&&(clearTimeout(u),u=setTimeout(function(){t.render();u=null},o))};return t.init=function(u){u=u||{};var c=u.offset||0,l=u.offsetVertical||c,a=u.offsetHorizontal||c,h=function(n,t){return parseInt(n||t,10)};r={t:h(u.offsetTop,l),b:h(u.offsetBottom,l),l:h(u.offsetLeft,a),r:h(u.offsetRight,a)};o=h(u.throttle,250);s=u.debounce!==!1;e=!!u.unload;f=u.callback||f;t.render();document.addEventListener?(n.addEventListener("scroll",i,!1),n.addEventListener("load",i,!1)):(n.attachEvent("onscroll",i),n.attachEvent("onload",i))},t.render=function(i){for(var h=(i||document).querySelectorAll("[data-echo], [data-echo-background]"),l=h.length,o,u,a={l:0-r.l,t:0-r.t,b:(n.innerHeight||document.documentElement.clientHeight)+r.b,r:(n.innerWidth||document.documentElement.clientWidth)+r.r},s=0;s